/*
 * Creato da SharpDevelop.
 * Utente: Administrator
 * Data: 21/01/2009
 * Ora: 17.27
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;

using System.Web.Caching;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ACM.cmsarea08.Controls
{
	/// <summary>
	/// Description of Class1.
	/// </summary>
	[DefaultProperty("DestinationControl")]
    [ToolboxData("<{0}:EventControl runat=server></{0}:EventControl>")]
	public class EventControl : Control
	{
        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("")]
        [Localizable(false)]
        public string EventString
        {
            get
            {
                object o = ViewState["EventString"];
                if (o == null) return string.Empty;
                else return o.ToString();
            }
            set
            {
                ViewState["EventString"] = value;
            }
        }
        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("")]
        [Localizable(false)]
        public string DestinationControl
        {
            get
            {
                object o = ViewState["DestinationControl"];
                if (o == null) return string.Empty;
                else return o.ToString();
            }
            set
            {
                ViewState["DestinationControl"] = value;
            }
        }

        protected override void OnLoad(EventArgs e)
        {
        	base.OnLoad(e);
        }
		protected override void Render(HtmlTextWriter writer)
        {
			if(this.EventString==string.Empty || this.DestinationControl==string.Empty) 
				return;
			writer.Write("<iframe src=\"/control_pages/event.aspx?ids=" +
			             		this.EventString + "&amp;idd=" +
			             		this.DestinationControl + "&amp;tp=null&amp;lg=" +
			             		ACM.cmsarea08.mainconfiguration.MainConf.LinguaPredefinita +
			             		"\" border=\"0\"></iframe>");
		}
        
	}
}
